package com.nike.amoeba.adapter

import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.TextView
import com.nike.amoeba.R
import com.nike.amoeba.bean.DataBean

/**
 * User: Nike
 *  2024/4/23 17:14
 */
class StockStorageAdapter(context: Context, data: ArrayList<DataBean>) :
    ArrayAdapter<DataBean>(context, R.layout.i_spinner_text, data) {

    override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
        val view = super.getView(position, convertView, parent)
        val tv = view.findViewById<TextView>(R.id.tv_text)
        val bean = getItem(position)
        tv.text = bean?.text
        return view
    }

    override fun getDropDownView(position: Int, convertView: View?, parent: ViewGroup): View {
        val view = super.getDropDownView(position, convertView, parent)
        val tv = view.findViewById<TextView>(R.id.tv_text)
        val bean = getItem(position)
        tv.text = bean?.text
        return view
    }
}